#include <decls.hpp>
#include <exceptions.hpp>
#include <natives.h>
#include <notifier.hpp>

JNIEXPORT jboolean JNICALL MODELS_PKG(Iterator, IsFlag) (JNIEnv *env, jclass clazz, jlong handle, jint flag)
{
    CUBEFS_EXC_BEGIN

    Iterator* iter = Handle2Ptr<Iterator>(handle);

    return iter->IsFlag(flag);

    CUBEFS_EXC_HANDLE
    return 0;
}


JNIEXPORT jboolean JNICALL MODELS_PKG(Iterator, Next) (JNIEnv *env, jclass clazz, jlong handle)
{
    CUBEFS_EXC_BEGIN

    Iterator* iter = Handle2Ptr<Iterator>(handle);

    return iter->Next();

    CUBEFS_EXC_HANDLE
    return 0;
}


JNIEXPORT void JNICALL MODELS_PKG(Iterator, GetValue) (JNIEnv *env, jclass clazz, jlong handle, jlong value_handle)
{
    CUBEFS_EXC_BEGIN

    Iterator* iter = Handle2Ptr<Iterator>(handle);
    Typed* holder = Handle2Ptr<Typed>(value_handle);

    iter->GetValue(holder);

    CUBEFS_EXC_HANDLE
}